#pragma once

#include <glm/glm.hpp>

namespace kanon
{
    class Camera3d 
    {
    public:
        uint32_t width;
        uint32_t height;

        glm::vec3 Position;
        glm::vec3 Front;
        glm::vec3 Up;
        glm::vec3 Right;

        glm::vec3 WorldUp;

        float Yaw;  // left/right
        float Pitch;  // up/down

        float MovementSpeed;
        float MouseSensitivity;
        float Zoom;

    public:
        Camera3d(glm::vec3 position = glm::vec3(0.0f, 0.0f, 3.0f));

        void setWindowSize(uint32_t width, uint32_t height);
        
        glm::mat4 getViewMatrix() const;
        glm::mat4 getProjectionMatrix() const;

        void moveForward(float offset);
        void moveUp(float offset);
        void moveRight(float offset);
        void zoomOut(float dz);
        void rotate(float xoffset, float yoffse0t, bool constrainPitchh = true);

    private:
        // void processKeyboard(int key, float deltaTime);
        // void processMouseMovement(float xoffset, float yoffset, bool constrainPitch = true);
        void updateCameraVectors();
    };

}
